package demo11.gumballstatewinner;
/**
 * 卖完状态
 * */
public class SoldOutState implements State {
	 GumballMachine gumballMachine;
	 
	    public SoldOutState(GumballMachine gumballMachine) {
	        this.gumballMachine = gumballMachine;
	    }
	 
		@Override
		public void insertQuarter() {
			System.out.println("你不能插入一个25分，因为糖果已经卖完了");
		}
	 
		@Override
		public void ejectQuarter() {
			System.out.println("你不能退出25分因为你没有插入25分。");
		}
	 
		@Override
		public void turnCrank() {
			System.out.println("你转动了摇杆，但是已经没有糖果了");
		}
	 
		@Override
		public void dispense() {
			System.out.println("没有糖果分发");
		}
		
		@Override
		public void refill() { 
			gumballMachine.setState(gumballMachine.getNoQuarterState());
		}
	 
		@Override
		public String toString() {
			return "卖光了";
		}
}
